package com.example.demo.practice.innerclass;

import android.util.Log;

import com.github.mikephil.charting.components.AxisBase;
import com.github.mikephil.charting.formatter.IAxisValueFormatter;

public class XFormatter implements IAxisValueFormatter {
    private String[] arr;

    public XFormatter(String[] arr) {
        this.arr = arr;
    }

    @Override
    public String getFormattedValue(float value, AxisBase axis) {
        int s= (int) value;
        if(s>arr.length){
            return "";
        }
        return arr[s-1];
    }
}
